package com.chenfan.ccp.entity;


import com.chenfan.ccp.plug.business.enums.BusinessLogTypeEnums;

public class CollectEventListener {

    private String traceId;
    private String data;
    private BusinessLogTypeEnums type;

    public String getTraceId() {
        return traceId;
    }

    public BusinessLogTypeEnums getType() {
        return type;
    }

    public void setType(BusinessLogTypeEnums type) {
        this.type = type;
    }

    CollectEventListener(final String traceId, final String data,final  BusinessLogTypeEnums type) {
        this.traceId = traceId;
        this.data = data;
        this.type=type;
    }

    public static CollectEventListenerBuilder builder() {
        return new CollectEventListenerBuilder();
    }

    public static class CollectEventListenerBuilder {
        private String traceId;
        private String data;
        private BusinessLogTypeEnums type;

        CollectEventListenerBuilder() {
        }

        public CollectEventListenerBuilder traceId(final String traceId) {
            this.traceId = traceId;
            return this;
        }

        public CollectEventListenerBuilder data(final String data) {
            this.data = data;
            return this;
        }

        public CollectEventListenerBuilder type(final BusinessLogTypeEnums type) {
            this.type = type;
            return this;
        }


        public CollectEventListener build() {
            return new CollectEventListener(this.traceId, this.data,this.type);
        }

        @Override
        public String toString() {
            return "EventListener.EventListenerBuilder(traceId=" + this.traceId + ", data=" + this.data + ")";
        }
    }

    public void setTraceId(String traceId) {
        this.traceId = traceId;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }
}
